
<?php
if (!defined('W_ROOT')) {
	exit();
}
require_once('../../libraryfiles/config.php');
require_once 'SQLFunction.php';

$include = '
<link rel="stylesheet" href="'.W_ROOT.'/css/admin_style.css" />
<script type="text/javascript" src="'.W_ROOT.'/js/action.js"></script>
<script type="text/javascript" src="'.W_ROOT.'/js/common.js"></script>
';
?>
<div id="content">
<form action="<?php echo base_url_admin ?>/setting/process.php?action=setting" method="post" enctype="multipart/form-data" id="form">
  <div class="breadcrumb">
        <a href="<?php echo base_url;?>/admin"><?php echo $lang['HOME'];?></a>
         :: <a href=""><?php echo $lang['GLOBAL_SETING'];?></a>
      </div>
    <div class="box">
    <?php
    	$settingSuccess = isset($_GET['message']) ? $_GET['message'] : "";
    	if($settingSuccess=='success'){
    		?>
    			<div class="success"><?php echo $lang['MESSAGE_UPDATE'];?></div>
    		<?php
    	}if($settingSuccess == 'invalidextention'){
    		?>
    			<div class="warning"><?php echo $lang['MESSAGE_UPLOAD_EXTENTION_ALLOWED'];?></div>
    		<?php
    	}
    	if($settingSuccess == 'invalidsize'){
    		?>
    			<div class="warning"><?php echo $lang['MESSAGE_UPLOAD_SIZE_ALLOWED'];?></div>
    		<?php
    	}
    ?>
    <div class="heading">
      <h1><img src="../templates/image/setting.png" alt="" /><?php echo $lang["GLOBAL_SETTING"];?></h1>
      <div class="buttons"><input class="button" type="submit" value="<?php echo $lang['SAVE'];?>" name="btnSaveSetting"/></div>
    </div>
    <div class="content">
 		<div id="tabs" class="htabs">
		<a href="#tab-general"><?php echo $lang['GENERAL'];?></a>
		<a href="#tab-product-seting"><?php echo $lang['PRODUCT_SETING'];?></a>
		<a href="#tab-email-config"><?php echo $lang['EMAIL_CONFIGURATION'];?></a>
		<a href="#tab-default-thumbnail"><?php echo $lang['THUMBNAIL'];?></a>
		<a href="#tab-default-visitors">Visitors Counter</a>
	</div>

	<div id="tab-general">
		<div id="language1">

            <table class="form">
              <tr>
                <td><span class="required">*</span>Site Title:<br/><span class="help"></span></td>
                <td><input type="text" name="store_site_title" size="80" value="<?php echo (DisplayGlobalSetting('site_title'))?DisplayGlobalSetting('site_title'):"";?>" />
                  </td>
              </tr>
              <tr>
                <td>Meta Tag Keywords:</td>
                <td><textarea name="meta_tag_keywords" cols="40" rows="5" style="margin: 2px; width: 439px; height: 81px;"> <?php echo (DisplayGlobalSetting('meta_tage_keyword'))?DisplayGlobalSetting('meta_tage_keyword'):"";?></textarea></td>
              </tr>
              <tr>
                <td>Meta Tag Description:</td>
                <td><textarea name="meta_tag_description" cols="40" rows="5" style="margin: 2px; width: 439px; height: 81px;"> <?php echo (DisplayGlobalSetting('meta_tage_description'))?DisplayGlobalSetting('meta_tage_description'):"";?></textarea></td>
              </tr>

              <tr>
                <td>Google Analytics id:</td>
                <td><input size="80"  type="text" name="google_analytics_id" id="" value=" <?php echo (DisplayGlobalSetting('google_analytic_id'))?DisplayGlobalSetting('google_analytic_id'):"";?>"/></td>
              </tr>
              <tr>
                <td>Logo:</td>
                <td><input size="80"  type="file" name="logo_change"/></td>
              </tr>
              <tr>
              	<td>Display Logo:</td>
              	<td><img width="250" height="90" src="../../images/<?php echo (DisplayGlobalSetting('logo'))?DisplayGlobalSetting('logo'):"";?>"/></td>
              </tr>
            </table>

          </div>
       </div>

       <div id="tab-product-seting">
                    <div id="language1">
            <table class="form">

              <tr>
                <td>Watermark Text:<br/><span class="help">Product</span></td>
                <td><input type="text" name="watermark_product" size="80" value="<?php echo (DisplayGlobalSetting('watermark'))?DisplayGlobalSetting('watermark'):"";?>" />
                  </td>
              </tr>
              <tr>
                <td><span class="required">*</span>Product Limit:<br/><span class="help">Free-account</span></td>
                <td><input type="number" name="product_limit_setting" size="80" value="<?php echo (DisplayGlobalSetting('free_account'))?DisplayGlobalSetting('free_account'):"";?>" />
                  </td>
              </tr>
              <tr>
                <td>Top province:<br /><span class="help">Top product in province</span></td>
                <td><input type="number" name="top_province" value="<?php echo (DisplayGlobalSetting('top_province'))?DisplayGlobalSetting('top_province'):"";?>" size="80" /></td>
              </tr>

            </table>
       </div>
  		</div>



        <div id="tab-default-thumbnail">
          	<table id="attribute" class="list">
           		<tr>
           		<td>Product thumnail:</td>
           			<td><input type="number" name="pro_thumbnail" value="<?php echo (DisplayGlobalSetting('product_thumbnail_w'))?DisplayGlobalSetting('product_thumbnail_w'):"";?>"/>X<input type="number"  value="<?php echo (DisplayGlobalSetting('product_thumnail_h'))?DisplayGlobalSetting('product_thumnail_h'):"";?>" /></td>
           		</tr>
           		<tr>
           			<td>Upload file size (MB):</td>
           			<td><input type="number" name="upload_image_size" value="<?php echo (DisplayGlobalSetting('upload_file_size'))?DisplayGlobalSetting('upload_file_size'):"";?>"/></td>
           		</tr>
          </table>
  		</div>
		
		<div id="tab-default-visitors">
          	<table id="attribute" class="list">
           		<tr>
           		<td>Display:</td>
           			<td><input type="checkbox" name="ischeckedVisitors" <?php echo (DisplayGlobalSetting('visitors') == 1)?"checked":"";?> value="1" /></td>
           		</tr>
          </table>
  		</div>



        <div id="tab-email-config">
          <table class="form">

              <tr>
                <td><span class="required">*</span>Mail Server:<br/><span class="help"></span></td>
                <td><input type="text" name="mail_server" size="80" value="<?php echo (DisplayGlobalSetting('mail_server'))?DisplayGlobalSetting('mail_server'):"";?>" />
                  </td>
              </tr>

              <tr>
                <td><span class="required">*</span>Port:<br/><span class="help"></span></td>
                <td><input type="text" name="mail_port" size="80" value="<?php echo (DisplayGlobalSetting('mail_port'))?DisplayGlobalSetting('mail_port'):"";?>" />
                  </td>
              </tr>

              <tr>
                <td><span class="required">*</span>Account Login:<br/><span class="help"></span></td>
                <td><input type="text" name="account_login" size="80" value="<?php echo (DisplayGlobalSetting('mail_user_login'))?DisplayGlobalSetting('mail_user_login'):"";?>" />
                  </td>
              </tr>
              <tr>
                <td><span class="required">*</span>Account Password:<br/><span class="help"></span></td>
                <td>
                	<input type="password" id="password" name="account_password" size="80" value="<?php echo (DisplayGlobalSetting('mail_user_password'))?DisplayGlobalSetting('mail_user_password'):"";?>" />
                	<input type="text" id="hidenPassword" size="80" />
                </td>
              </tr>
              <tr>
              	<td></td>
              	<td><input id="showpassword" type="checkbox" value="0" /> <label for="showpassword">Show Password</label></td>
              </tr>
            </table>
        </div>
       </div>

    </div>
  </div>
  </form>
</div>
</script>
</div>
<script type="text/javascript" src="<?php echo base_url; ?>admin/templates/javascript/ckeditor/ckeditor.js"></script>
<script>
    $(document).ready(function() {
        CKEDITOR.replace('txtdesc', {
            filebrowserBrowseUrl: 'imageUpload.php',
            filebrowserImageBrowseUrl: 'imageUpload.php',
            filebrowserFlashBrowseUrl: 'imageUpload.php',
            filebrowserUploadUrl: 'imageUpload.php',
            filebrowserImageUploadUrl: 'imageUpload.php',
            filebrowserFlashUploadUrl: 'imageUpload.php',

        });
        CKEDITOR.replace('descr_address', {
            filebrowserBrowseUrl: 'imageUpload.php',
            filebrowserImageBrowseUrl: 'imageUpload.php',
            filebrowserFlashBrowseUrl: 'imageUpload.php',
            filebrowserUploadUrl: 'imageUpload.php',
            filebrowserImageUploadUrl: 'imageUpload.php',
            filebrowserFlashUploadUrl: 'imageUpload.php',

        });
    });
    $('#tabs a').tabs();
</script>

<?php require_once TMP_ADMIN_PATH;?>